package com.example.high_slope_electronic_sand_table.surroundings.service;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.example.high_slope_electronic_sand_table.surroundings.dto.SurrondingsDTO;
import org.springframework.stereotype.Service;

@Service
public class SurrondingsService {
    /**
     * 查询周边环境
     * @return
     */
    public SurrondingsDTO getSurrondings(){
        SurrondingsDTO surrondingsDTO = new SurrondingsDTO();
        surrondingsDTO.setDownstreamHeadcount(RandomUtil.randomInt(461,463));
        surrondingsDTO.setDownstreamStructure(82);
        surrondingsDTO.setRiver("2条");
        surrondingsDTO.setVillage("2个");
        surrondingsDTO.setSchool("4个");
        surrondingsDTO.setVitalFacility("5个");
        // 生成时间、当前时间
        surrondingsDTO.setDatetime(DateUtil.format(DateUtil.date(), DatePattern.NORM_DATETIME_PATTERN));
        return surrondingsDTO;
    }
}
